package com.zz.ecommerce.searchManage.goods.preclassified;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by admin on 2016/4/6.
 */
@Repository
public interface HsCodeDao {

    @Select("select st.tariff_code,\n" +
            "       st.goods_name,\n" +
            "       st.add_rate,\n" +
            "       st.mfn_rate,\n" +
            "       st.comm_rate,\n" +
            "       st.export_rate,\n" +
            "       st.export_back_rate,\n" +
            "       ss.cnt\n" +
            "  from busi_param.S_tariff st,\n" +
            "       (select sct.tariff_code,count(1) as cnt\n" +
            "          from busi_param.S_COMPLEX_tariff sct\n" +
            "         where sct.code_ts = #{hsCode} group by sct.tariff_code) ss\n" +
            " where ss.tariff_code = st.tariff_code order by cnt desc")
    List<Map> queryMapTariffInfoList(String hsCode);
}
